package com.gtw.modules.api.controller;

import com.gtw.common.annotation.LoginUserApi;
import com.gtw.common.utils.R;
import com.gtw.modules.entity.TbDividendRule;
import com.gtw.modules.entity.TbUser;
import com.gtw.modules.sys.service.SysDividendRuleservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/** 代理Controller
 * Created by wuye on 2018/3/14.
 */
@RestController
@RequestMapping("/api/agent")
public class TbAgentController {


    @Autowired
    private SysDividendRuleservice sysDividendRuleservice;

    /**
     * 加载用户的代理详情(代理资产余额)
     * @return
     */
    @RequestMapping("/loadUserAgentInfo")
    public R loadUserAgentInfo(@LoginUserApi TbUser tbUser){

        return R.ok();
    }


    /**
     * 获取代理分红规则
     * @return
     */
    @RequestMapping("/queryRule")
    public R queryRule(){
        TbDividendRule tbDividendRule = sysDividendRuleservice.queryObject(1);
        return R.ok().put("data",tbDividendRule);
    }
}
